<?php
class DB
{
	public function construct()
	{
		
	}
	
	public function fetchRow($sql)
	{
		$qry = mysql_query($sql);
		$rw = mysql_fetch_array($qry);
		
		return $rw;
	}
	
	public function fetchAll($sql)
	{
		$qry = mysql_query($sql);
		while($rw = mysql_fetch_array($qry))
		{
			$result[] = $rw;
		}
		
		return $result;
	}
	
	public function exec($sql)
	{
		$qry = mysql_query($sql);
		return true;
	}
	
	public function rowCount($sql)
	{
		$qry = mysql_query($sql);		
		$result = mysql_num_rows($qry);		
		return $result;
	}
	
	public function lastInsertID()
	{
		$last_insert_id = mysql_insert_id();
		
		return $last_insert_id;
	}
}	
?>